import http from '@/common/http.js'

export async function getGoodsList(data) { //获取所有商品分类列表
	return await http({
		url: '/api/goods/getGoodsTypeList',
		method: 'GET',
		data: data
	})
}

export async function getAddrTree(data) { //获取区域列表
	return await http({
		url: '/api/goods/getAddrTree',
		method: 'GET',
		data: data
	})
}

export async function getGoodsListbytype(data) { //根据商品分类获取列表
	return await http({
		url: '/api/goods/getGoodsList',
		method: 'GET',
		data: data
	})
}

export async function getGoodsInfo(data) { //根据商品id获取商品信息
	return await http({
		url: `/api/goods/getGoodsInfo/${data.id}`,
		method: 'GET',
		data: data
	})
}

export async function getGouponByid(data) { //根据商品id获取优惠券
	return await http({
		url: `/coupon/getCouponByProId/${data.id}`,
		method: 'GET',
		data: data
	})
}

export async function getGouponList(data) { //根据商品id获取优惠券
	return await http({
		url: '/coupon/getCouponList',
		method: 'GET',
		data: data
	})
}

export async function getGoodsStoreByid(data) { //根据门店id获取详情
	return await http({
		url: `/api/goods/goodsStoreById/${data.id}`,
		method: 'GET',
		data: data
	})
}

export async function getGoods(data) { //获取所有商品列表
	return await http({
		url: '/api/goods/getGoods',
		method: 'GET',
		data: data
	})
}

export async function getProtocol(data) { //团购标签说明
	return await http({
		url: `/protocol/${data.protCode}`,
		method: 'GET',
		data: data
	})
}

export async function getGoodsKill(data) { //获取秒杀商品列表
	return await http({
		url: '/api/goods/seckill',
		method: 'GET',
		data: data
	})
}

export async function getCouponList(data) { //获取用户可领取优惠券列表
	return await http({
		url: '/coupon/getCouponList',
		method: 'GET',
		data: data
	})
}

export async function getRoomDate(data) { //获取房型日历
	return await http({
		url: '/api/goods/goodsRoom',
		method: 'GET',
		data: data
	})
}